#ifndef __IL19431_H
#define __IL19431_H

#include <stdint.h>

#define LCD_Wide 320
#define LCD_High 240

#define WHITE         	 0xFFFF
#define BLACK         	 0x0000	  
#define BLUE         	 0x001F  
#define BRED             0XF81F
#define GRED 			 0XFFE0
#define GBLUE			 0X07FF
#define RED           	 0xF800      
#define GREEN         	 0x07E0
#define CYAN          	 0x7FFF
#define YELLOW        	 0xFFE0
#define BROWN 			 0XBC40 
#define BRRED 			 0XFC07 
#define GRAY  			 0X8430 
#define DARKBLUE      	 0X01CF	
#define LIGHTBLUE      	 0X7D7C	
#define GRAYBLUE       	 0X5458 
#define LIGHTGREEN     	 0X841F 
#define LIGHTGRAY        0XEF5B 
#define LGRAY 			 0XC618 
#define LGRAYBLUE        0XA651 
#define LBBLUE           0X2B12 

#define cblock1	0XEBE6
#define cblock2	0X4398
#define cblock3	0X5742
#define cblock4	0XFE00
#define cblock5	0X2EB4
#define cblock6	0XC7C2
#define cblock7	0X922F
#define cblock8	0XF4D4
#define cblock9	0XBD9A
#define cblock10	0XD923
#define cblock11	0X806C
#define cblock12	0XE9CE
#define cblock13	0XC716
#define cblock14	0X28AD
#define cblock15	0X066C
#define cblock16	0XA004
#define cblock17	0XFFF3
#define cblock18	0X730B
#define cblock19	0X3619
#define cblock20	0X046E

#define BLEDon	1
#define BLEDoff	!BLEDon

typedef struct{
	uint16_t width;
	uint16_t height;
	uint16_t id;
	uint8_t dir;
	uint16_t brushcl;
	uint16_t backcl;
	uint16_t cur_brushcl;
	uint16_t cur_backcl;
	uint8_t bled;
} lcd_odev_struct;

extern lcd_odev_struct lcddev;

void IL19341_Init(void);
void IL19341_DispString(uint16_t x, uint16_t y, char *p, uint8_t csize, uint8_t mode);
void IL19341_DispNum(uint16_t x, uint16_t y, uint32_t num, uint8_t len, uint8_t size);

#endif
